﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 器材新增字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MaxSafetyStock",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "MinSafetyStock",
                table: "TMaterials");

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryCode",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Price",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Qty",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "QualityState",
                table: "TMaterials",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<decimal>(
                name: "ReceivePrice",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "ReceivedQty",
                table: "TMaterials",
                type: "decimal(18,2)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MaterialCategoryCode",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Price",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Qty",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "QualityState",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "ReceivePrice",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "ReceivedQty",
                table: "TMaterials");

            migrationBuilder.AddColumn<int>(
                name: "MaxSafetyStock",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "MinSafetyStock",
                table: "TMaterials",
                type: "int",
                nullable: true);
        }
    }
}
